﻿<!DOCTYPE HTML>
<html xmlns:th="http://www.thymeleaf.org">
<head th:include="admin/header :: css">
    <title>支付列表</title>
</head>
<body>
<nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页 <span class="c-gray en">&gt;</span> 支付管理 <span class="c-gray en">&gt;</span> 提现列表 <a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新" ><i class="Hui-iconfont">&#xe68f;</i></a></nav>
<form id="form-article-list" action="/admin/sensitiveword/list" >
<input type="hidden" id="pageNum" name="pageNum" th:value="${pageNum}"/>
<div class="page-container">
	<div class="text-c"  style="text-align:left">
		<button onclick="removeIframe()" class="btn btn-primary radius">关闭选项卡</button>
		检索关键字
		<input type="text" name="findtext" id="findtext" placeholder="敏感词关键字" style="width:250px" class="input-text" th:value="${findtext}"/>
		<button name="" onclick="javascript:list();" class="btn btn-success" type="button"><i class="Hui-iconfont">&#xe665;</i> 检索</button>
	</div>
	<div class="cl pd-5 bg-1 bk-gray mt-20"><span class="l"> <a class="btn btn-primary radius" data-title="添加敏感词" onclick="sw_add('添加敏感词','/admin/sensitiveword/addSwInit')" href="javascript:;"><i class="Hui-iconfont">&#xe600;</i> 添加敏感词</a></span><span class="r" >共有数据：<strong th:text="${pageInfo.total}">54</strong> 条</span> </div>
	<div class="mt-20">
		<table class="table table-border table-bordered table-bg table-hover table-sort">
			<thead>
				<tr class="text-c">
					<th width="50">内部编号</th>
					<th width="150">敏感词</th>
					<th width="150">操作</th>
				</tr>
			</thead>
			<tbody>
				<tr class="text-c" th:each="model:${pageInfo.list}" th:object="${model}">
					<td th:text="*{id}">1</td>
					<td th:text="*{word}">100</td>
					<td class="f-14 td-manage">
						<a style="text-decoration:none" class="ml-5" th:onclick="'javascript:sw_edit(\'敏感词编辑\',\'/admin/sensitiveword/editSwInit\',' + *{id} + ')'" onClick="sw_edit('敏感词编辑','/admin/sensitiveword/editArticleInit','10001')" href="javascript:;" title="编辑">
						<i class="Hui-iconfont">&#xe6df;</i></a> 
						<a style="text-decoration:none" class="ml-5" th:onClick="'javascript:sw_del(' + this + ',' + *{id} + ')'" href="javascript:;" title="删除"><i class="Hui-iconfont">&#xe6e2;</i></a>
					</td>
				</tr>
			</tbody>
		</table>
		<div th:replace="admin/page :: page"></div>
	</div>
</div>
<div style="margin-top:15px; text-align:center;" id="page11"></div>
<div th:replace="admin/footer :: footer"></div>
</form>

<!--请在下方写此页面业务相关的脚本-->
<script type="text/javascript" th:src="@{/h-ui/lib/My97DatePicker/4.8/WdatePicker.js}"></script> 
<script type="text/javascript">

/** 检索 */
function list(){
	$("#form-article-list").submit();
}

laypage({
	  cont: 'page11',
	  pages: $("#pages").val(), //可以叫服务端把总页数放在某一个隐藏域，再获取。假设我们获取到的是18
	  curr: $("#pageNum").val(), 
	  jump: function(e, first){ //触发分页后的回调
	    if(!first){ //一定要加此判断，否则初始时会无限刷新
	      $("#pageNum").val(e.curr)
	      $("#form-article-list").submit();
	    }
	  }
});

/*敏感词-添加*/
function sw_add(title,url,w,h){
	var index = layer.open({
		type: 2,
		title: title,
		content: url
	});
	layer.full(index);
}
/*敏感词-编辑*/
function sw_edit(title,url,id,w,h){

	var index = layer.open({
		type: 2,
		title: title,
		content: url + "?id=" + id
	});
	layer.full(index);
}
/*敏感词-删除*/
function sw_del(obj,id){
	layer.confirm('确认要删除吗？',function(index){
		$.ajax({
			type: 'POST',
			url: '/admin/sensitiveword/delSw',
			data : {
				"id" : id
			},
			dataType: 'json',
			success: function(data){
				$(obj).parents("tr").remove();
				layer.msg('已删除!',{icon:1,time:1000});
			},
			error:function (XMLHttpRequest, textStatus, errorThrown) {
				alert("删除敏感词出错");
                if(XMLHttpRequest.status == 403){
                    layer_close();
                    errorMessage('无权操作!');
                }else {
                    errorMessage("系统错误!");
                }
            },
		});		
	});
}
</script> 
</body>
</html>